/*
* Copyright 2006 Javector Software LLC
*
* Licensed under the GNU General Public License, Version 2 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.gnu.org/copyleft/gpl.html
*
* THE SOURCE CODE AND ACCOMPANYING FILES ARE PROVIDED WITHOUT ANY WARRANTY,
* WRITTEN OR IMPLIED.
*
* The copyright holder provides this software under other licenses for those
* wishing to include it with products or systems not licensed under the GPL.
* Contact licenses@javector.com for more information.
*/
package samples;

import java.io.FileNotFoundException;
import java.io.InputStream;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;

//! <example xn="OrderManagerPOJO_Serlet">
//! <c>chap03</c><s>rest-get</s>
public class OrderManager {
  
  public Source getNewOrders() throws FileNotFoundException {
    // get the resource the provides the new orders
    InputStream src = getClass().getResourceAsStream("/orders.xml");
    if ( src == null ) {
      throw new FileNotFoundException("/orders.xml");
    }
    return new StreamSource(src);
  }
  
}
//! </example>

